package com.health.circle.controller;


import com.health.circle.domain.vo.PatientCircleVo;
import com.health.circle.service.IPatientCircleService;
import com.health.common.core.domain.R;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 病友圈信息表 前端控制器
 * </p>
 *
 * @author zzs
 * @since 2024-12-16
 */
@RestController
@RequestMapping("/circle")
public class PatientCircleController {

    @Autowired
    private IPatientCircleService service;

    /**
     * 根据科室查询病状
     * @param departmentId
     * @return
     */
    @GetMapping("/Byid/{departmentId}")
    public R<List<PatientCircleVo>> Byid(@PathVariable("departmentId") Integer departmentId){
        List<PatientCircleVo> list =  service.findByDepartmentId(departmentId);
        return R.ok(list);
    }

    /**
     * 查询病状详情
     * @param receivedId
     * @return
     */
    @GetMapping("/details/{receivedId}")
    public R<PatientCircleVo> details(@PathVariable("receivedId") Integer receivedId){
        PatientCircleVo byId = service.getDetailsByid(receivedId);
        return R.ok(byId);
    }










}
